Due Thursday, Nov 2, 2000
(at start of 10:10am class)
The second project milestone is a working implementation of a significant chunk of the map framework. At a minimum, you need to write both the general-purpose directed-graph data structure and the code that constructs the directed-graph representation of the street map.
In addition, the second milestone has a small amount of ancillary code that allows us to observe your implementation in action; specifically, we ask you to print the adjacency lists of all of the nodes of the street-map graph that you construct.
If you have your GUI code operational by then (not required at this date), you may avoid the ancillary code by submitting screenshots of one configuration. Of course, you'd need to submit your GUI code too.
class MilestoneII { public static void main(String[] args) { if (args.length != 2) { System.out.println("Need two command-line arguments."); System.out.println("In CodeWarrior, select 'Java Application Settings...'" + " in the Edit menu."); System.out.println("Place your argument in the 'Parameters' box."); System.exit(-1); } int nVertical = Integer.parseInt(args[0]); int nHorizontal = Integer.parseInt(args[1]); // construct the directed graph representation of a street map // with nVertical north-south streets and nHorizontal east-west // streets (probably by calling a street-map-construction method // that's been defined in another class). // print the adjacency lists of the nodes in the constructed graph. // (formatting details are given below.) // ...you don't need to worry about handling improper command-lines // [negative dimensions, etc.]. } }In order to have a human-readable names for the nodes, it is necessary to assign a unique string identifier to each node [e.g., "T16" for the sixteenth street segment tile (in order of construction, say) and "I3" for the third intersection]. Once you've done this, printing the adjacency lists is quite simple... For each node in the directed graph, print the node's ID followed by the ID's of the nodes that are adjacent to it, in the following format:
I3: T4 T7 T11 T14Nodes may be listed in any order.
[Clarification: the street map is a uniform nVertical-by-nHorizontal grid, like the simple #-shaped map that is depicted in the project specification. (In that example, nVertical and nHorizontal are both 2.) In general, there are nVertical * nHorizontal intersections, and the total number of street segments is nVertical * (nHorizontal + 1) + nHorizontal * (nVertical + 1).]
Also, please be sure to keep a copy of this version of the UML diagrams to submit as part of the "design record" that will accompany your finished project.
For hand-drawn diagrams, you may cut and paste material from your previous set of diagrams, as long as you do it neatly and submit a crisp photocopy of it.